<?php

namespace INT\AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Matiere
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Matiere {

    /**
     * @ORM\ManyToMany(targetEntity="INT\UserBundle\Entity\User" ,mappedBy="matieres")
     */
    private $users;
    
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\OneToMany(targetEntity="Seance", mappedBy="matiere")
     */
    private $seances;

    /**
     * @var string
     *
     * @ORM\Column(name="code", type="string", length=255)
     */
    private $code;

    /**
     * @var string
     *
     * @ORM\Column(name="designation", type="string", length=255)
     */
    private $designation;

    /**
     * @var string
     *
     * @ORM\Column(name="coefficient", type="string", length=255)
     */
    private $coefficient;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set code
     *
     * @param string $code
     * @return Matiere
     */
    public function setCode($code) {
        $this->code = $code;

        return $this;
    }

    /**
     * Get code
     *
     * @return string 
     */
    public function getCode() {
        return $this->code;
    }

    /**
     * Set designation
     *
     * @param string $designation
     * @return Matiere
     */
    public function setDesignation($designation) {
        $this->designation = $designation;

        return $this;
    }

    /**
     * Get designation
     *
     * @return string 
     */
    public function getDesignation() {
        return $this->designation;
    }

    /**
     * Set coefficient
     *
     * @param string $coefficient
     * @return Matiere
     */
    public function setCoefficient($coefficient) {
        $this->coefficient = $coefficient;

        return $this;
    }

    /**
     * Get coefficient
     *
     * @return string 
     */
    public function getCoefficient() {
        return $this->coefficient;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->seances = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add seances
     *
     * @param \INT\AdminBundle\Entity\Seance $seances
     * @return Matiere
     */
    public function addSeance(\INT\AdminBundle\Entity\Seance $seances)
    {
        $this->seances[] = $seances;
    
        return $this;
    }

    /**
     * Remove seances
     *
     * @param \INT\AdminBundle\Entity\Seance $seances
     */
    public function removeSeance(\INT\AdminBundle\Entity\Seance $seances)
    {
        $this->seances->removeElement($seances);
    }

    /**
     * Get seances
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getSeances()
    {
        return $this->seances;
    }
    public function __toString() {
        return $this->getDesignation();
    }

    /**
     * Add users
     *
     * @param \INT\UserBundle\Entity\User $users
     * @return Matiere
     */
    public function addUser(\INT\UserBundle\Entity\User $users)
    {
        $this->users[] = $users;
    
        return $this;
    }

    /**
     * Remove users
     *
     * @param \INT\UserBundle\Entity\User $users
     */
    public function removeUser(\INT\UserBundle\Entity\User $users)
    {
        $this->users->removeElement($users);
    }

    /**
     * Get users
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsers()
    {
        return $this->users;
    }
}